Hints for STL coders.
- Don't forget that the "last" iterator points "one past".
- For your custom objects, define:
- a default constructor
- a copy constructor
- operator=
- operator<
- operator==
- If it ain't broke break it. Better to learn how the complier complains when you do know what the fix is.
- Don't do relational compares on iterators. Only use == or !=.
- Don't forget to match the const/non-constness or iterators and containers.
- Watch nested templates--don't let them look like ">>"
vector<int, allocator<int> > v;
- Objects are copied into containers. The original object still exist and may need to be deleted.